package com.pay.common.utils;

import lombok.Data;

@Data
public class Result {
    private int code;

    private String msg;

    private Object data;



    public static Result ok(){
        Result result = new Result();
        result.setCode(200);
        result.setData(null);
        result.setMsg("操作成功");
        return result;
    }
    public static Result error(){
        Result result = new Result();
        result.setCode(500);
        result.setData(null);
        result.setMsg("操作失败");
        return result;
    }


    public int getCode() {
        return code;
    }

    public Result setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Result setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getData() {
        return data;
    }

    public Result setData(Object data) {
        this.data = data;
        return this;
    }
}
